package org.feng.manage.sys;

import lombok.Data;

/**
 * 操作上下文
 *
 * @author 01434188
 */
@Data
public class OperateContext<T> {

    /**
     * 操作
     */
    private OperateEnum operate;

    /**
     * 数据
     */
    private T data;


    public <R> R execute() {
        AbstractOperateHandlerTemplate<T, R> operateHandler = (AbstractOperateHandlerTemplate<T, R>)OperateHandlerFactory.getOperateHandler(operate);
        return operateHandler.start(this);
    }

}
